Sword & sorcery (anti-)heroes tend to fit the D&D PC mold fairly well. They're traditionally outcasts or wanderers, who don't really fit in anywhere. While they often fight evil, they're motivated by base urges, like lust or a desire for gold, instead of selfless ones. The settings usually draw more from the ancient world than the medieval, though there are tons of exceptions (like the Puritan Solomon Kane). The stories tend to extol the virtues of physical strength, martial prowess, and fortitude over more intellectual pursuits, and usually portray things like civilization and magic as decadent and corrupt or corrupting.
If you're looking for inspiration, start with R.E. Howard's Conan stories. They're the archetype. Secondarily, try Fritz Leiber's Fafhrd and the Gray Mouser stories, which are amazingly well written and one of the core inspirations for D&D. Burroughs' John Carter of Mars books are another good resource, taking the genre to a fantastic planet with wondrous tech, and are another direct inspiration of D&D. I wouldn't start with Moorcock's Elric because it's a deliberate subversion of the standard tropes, but it's also a good example of the genre once you have some of the others under your belt, and is especially notable for incorporating a lot of magic and cosmic events.