There are some books based on D&D, but I haven't read them. I have read the following, but mostly back in the late 80s/early 90s.
Joel Rosenberg - Guardians of the Flame series, follows characters pulled into the world of their RPG. Written in the 80s, so it's old-style gaming with dice and a board. Haven't re-read it, but he did some interesting things with characterisation that stuck in my memory all these years.
Traditional fantasy with easy to spot good band of Companions vs supernatural evil:
Tolkein - LOTR

From where all the tropes descend...
David Eddings - start with the Belgariad (5 books), then if that's not enough read the Mallorean, which is pretty much identical. Standard (but immensely popular in its day) Tolkein imitation.
Terry Brooks - the Shannara series.
Once you've had enough of the epic fantasy tropes:
Diana Wynne Jones - The Tough Guide to Fantasyland. Better than tvtropes. Also proof that female British writers *can* write decent books about boy wizards. ;P