Strangely, Gary Gygax professes not to be a major Tolkien fan. He apparently prefers the pulp fantasy of the '30s. The Tolkien elements were put in to appease the rest of fantasy fandom, many of whom believe that the genre begins and ends with LOTR.
You can find a lot of pulp elements in D&D.
The original Thief and Assassin classes come straight from Fritz Leiber’s Lankmar stories. So too does the old strickly human ability to Dual Class, that is, quit one class and begin another. The heroes of the Lankmar stories, Fafred and the Grey Mouser, both do this early in their careers. Wererats also owe their existance to this series, in particular, “Swords of Lankmar” (Skaven from Warhammer Fantasy were also inspired by this work).
The entire magic system comes from Jack Vance. The 1e DMG mentions this.
Many Lovecraft elements have already been mentioned, but D&D Ghouls also bear a striking resemblence to Mr. Pickman and associates. Lovecraft also has Ghasts, after which the D&D version was probably named. Gugs, however, are notably absent in D&D.
I’ve read that Conan was the original inspiration for the Fighter class, but the later Barbarian class was a direct rip of him. 1e Barbarians couldn’t use any magic (even items) at all until later levels, but they could summon a horde of warriors.
But D&D really is a giant cultural vaccuum that sucks up anything Gygax or later authors thought was cool.
Monks, for instance, came out the '70s TV show Kung-Fu.
Clerics were based of the historical Hospitalers, the first military branch of the Catholic Church. Originally, priests were forbidden from carrying swords (for fear of dying by them), so they got around that by carrying maces. Hospitalers were eventually allowed to carry arms, but only after the Templars started doing it.
Bards and Druids are from Celtic tradition. Both originally had a very strict rules and hierarchies. For example, there were a fixed number of upper level Druids in the world, and once you reached a certain level, you could go up any higher until a slot opened up.
Paladins come from Arthurian legend, though I think that comes from Charlemain.
Rangers come from English tradition. They were (and still are) the protectors of the land. Tolkien has not one but two groups of Rangers, which might be a more direct source. Fafred also displayed very Ranger-like abilities, and in fact is listed as one in my insanely old Dieties and Demigods (the one with the Cthulhu and Elric mythos in it).
Tiamat and Bahamut, the dragons, have named ripped out of Sumarian Myths (though the dragons are nothing like the mythological critters).
Coatls are the feathered serpents of Aztec legend, whilst Kirins are Japanese dragons (and beer). The Lamassu is a Babalonian invention, as is the Shedu (in fact, these names seemed to be interchangeble).
And there is much much more. As a kid I was always amazed when some of these would come up. D&D really was my introduction to a lot of this stuff, and I would always get excited when I encountered in the real world. Now, however, I can’t help by realize just how little original thought actually went into the first editions of D&D.