Cross-posted to Jennifer's History and Stuff.
In the late 1300s, we see the first British record of a found horseshoe being considered lucky. This belief has been held by pretty much every horseshoe-producing culture, from Scandinavia to Asia. The key was to have a found horseshoe, rather than a new horseshoe, and various degrees of luck were associated with intact nails, number of nail holes, etc.
By the late 1500s, the English were nailing their found horseshoes above their doors to keep the witches at bay. This is probably related to a long-held belief in the power of iron, which protected European people from fairies and other spirits before witches came along.
As we got closer to 1900, horseshoes above the door were less about witches and more for general luckiness. Whether the horseshoe’s ends should face up or down has never been completely resolved. Some people think facing the ends up will keep the luck from falling out of the horseshoe, while others believe facing the ends down will direct all that luckiness to the people walking below it.
Reference: Most of the material from this post was found in Christina Hole's The Encyclopedia of Superstitions and Steve Roud's The Penguin Guide to the Superstitions of Britain and Ireland.