I tend to think of classics in the genre as 'those that did it first'.
Lord of the Rings. -- The seminal fantasy novel for most of the modern age. The first fantasy book that I am aware of to acheive mainstream recognition as literature worthy of critical acclaim, and thus open up the idea of fantasy lit to more people.
For decades, science fiction was a ghetto of literature, something you didn't tell people you read. Fantasy was the ghetto of the ghetto; you could go to a gathering of SF fans and Fantasy was the Pleasure That Dare Not Speak It's Name. LOTR helped break that.
The Worm Ouroboros by E.R. Eddison -- Classic work of imagination on several levels; possibly the first fantasy book to include historical timelines and such detail work.
Earthsea -- A classic for being a gentler tale of magic and involved emotions. The world and concept of magic were refreshingly original and the presentation was first rate.
A Wrinkle In Time -- And the associated books; classics for the depth and bredth of pure imagination involved.
Conan -- Conan definately belongs to that 'been there first' catagory, and certain in regards to D&D in particular. Pretty much whatever you've done in a D&D campaign, Conan was there first and did it better. You can almost feel the burning flame of Howard's imagination on the pages, a flame that burned for much to short a time.
Elric -- And associated books. A classic for taking a moribund genre, mired in pale imitations of Conan and King Arthur, ans shattered almost all the genre conventions of the time. Instead of the hero being the muscled warrior slashing down the effete mage, the hero was an anti-hero, was an effete mage, etc etc.
The Fahfrd and Grey Mouser -- The original buddy team of fantasy heroes.
Works from the great classics: Shelley, Verne, Wells, Burroughs, H. Rider Haggard, Ray Bradbury
The Swords and Sorceresses series edited by Marion Zimmer Bradley -- Some of the first tales featuring female protagonists.
The King of Elfland's Daughter by Lord Dunsany -- Dunsany is one of the first fantacists of the modern era. Pretty much all his stuff is important to an understanding of the genre, esp The Gods of Pegana.
The Deryni Series by Katharine Kurtz -- One of the first fantasy books to deal with persecution.