An icehouse used to be exactly what the name implies: a building used to store ice. The first recorded ones date back to Mesopotamia around 2000 B.C.; those rich enough to afford it would have snow and ice brought down from mountaintops and stored in straw-lined pits in the floor of the low building. A lot would have melted by summer, but enough was left to be useful for cooling.

The idea was popular; it spread or was thought of independently throughout the ancient world. The Romans introduced icehouses into the conquered portion of their empire, until even places as far from Rome as Great Britain had icehouses. Their popularity among the rich was seen as overly indulgent by others, though. Their use waxed and waned, reaching another peak starting in the seventeenth century. Ice from icehouses was not particularly clean or pure, though; it was often contaminated with straw or sawdust from the storage pit and not something a modern person would want to put in their drink.

The icehouse idea took off in North America, where the cold winters and hot summers gave both a supply of ice and a desire for it. In New England, ice harvesting from ponds and rivers became an industry; some was used locally and some was packed on ships and taken south to other colonies or even across the Atlantic to England. This kept on for years; a new type of icehouse invented in the 1820s reduced melting from 60% of the ice to only 8%. Along with horse-driven ice-cutting equipment rather than hand-sawing out block of ice, this caused the price of ice to become a lot more reasonable in the United States; the use of ice became a lot more widespread than it ever had been in Europe. This may account for the greater popularity of iced drinks in the U.S. than in many other countries. Large estates might have an icehouse that would hold several tons of ice just for family use.

The icehouse continued to be used even after electrical refrigeration was available; the name was applied to the building where ice is made rather than just stored. Large blocks of ice are still used by many food industries, as well as being carved into ice sculptures.

Sources:
Barr, Andrew. Drink: A Social History of America. New York: Carroll & Graf Publishing, Inc., 1999.
http://www.capepondice.com/history.html
http://www.geocities.com/NapaValley/4079/History/IceCream/IceCreamHistory.htm