The Rohan people of Middle-Earth are directly inspired by the inhabitants of the land in which Beowulf takes place. Everything from there language ( which is an altered form of old english ) to their ways of living, and the Golden Hall was inspired by the mead hall in Beowulf. I n a documentary about Tolkien on the Extended DVDs it is stated that Tolkien was dissapointed at the lack of mythology England had. And he didn't consider King Arthur Engligh mythology because it is actually French this salso stated in the Documentary. So to fix this problem he constructed his own mythology not necesarily about England but of a land somewhat similar to and ancient english land. So yes he also borrowed and got inspiration from other storie. Every author does in some small way.
P.S. Tolkien didn't invent orcs or elves, or ents. He just made these magical and mythological beings his own and constructed them to fit his story.