Midgard

Midgard is featured in Norse mythology as the home of the human race. It is also called Manheim, Mannheim, Manna-heim, and, interestingly enough, Middle-earth.

Midgard was created by the three gods Odin, Hœnir (Vili), and Lodur (Ve). Once it was created, the gods began to create the human race from tree trunks on the beach. The first humans were Askr and Embla. A gift was given to humans by each god. Odin gave them breath, Hœnir gave them spirit and understanging, and Lodur gifted them with their outward appearance and sense.

In the Rigsthula, from the Poetic Edda, Heimdall (Rig) created human society, which was divided into 3 social classes. Heimdall had the hospitality of 3 couples in 3 different houses. All of the couples were old and were great-grandparents. Secretly, Heimdall slept with the wife of each house. Each wife bore a son.

His first son was Thrall, a labourer. Thrall later married Slavegirl, and they were the ancestors of the slaves and labourers in the world, forming the lowest social class.

The second son was Farmer. He and his wife were the ancestors of farmers in the world, the second the social class.

Heimdall's third son was Lord. Lord married Erna, the daughter of Chieftain. They became the ancestors of the nobles, the highest social class.

Middle-earth was surronded by a fence made of Ymir's eyelashes to keep the giants out.

Midgard relates to Tolkien not only because of the name, but also the idea of "gifts" granted to the races by the gods. The gift to Man was mortality, as the Elves' gift was immortality. You'll also notice a lack of giants in Middle-earth. There are social classes in Middle-earth, although I don't think this was based off Heimdall.