Closing costs are generally location-specific, but the categories don't change.
* You have to pay your lawyer. DO NOT attempt to buy a home without one. Realtors can be lovely (I am one) but only your attorney has your best interests at heart.
* You have costs associated with your loan. Your mortgage broker can explain this, and so does Carolyn Warren's fantastic book, "Mortgage Ripoffs and Money Savers" -- it will save you hundreds, if not thousands.
* You have to pay a tax associated with the amount of money you're borrowing. In New York City this is 1% of the amount borrowed. Ask a realtor and/or mortgage person in your area what the mortgage tax is.
* Taxes have to paid when real estate is transferred -- whether the buyer or seller pays them is, again, a function of the local market. Everybody likes to get their fingers in these real estate transfer taxes (in NYC, we just call them RETT) so again, research what the state wants and what the county/city wants, because you'll have to pay both. A search for "Massachusetts Department of State -- taxes" should lead you to a website where this would be explained.
Hope that helps -- oh, and you might enjoy my book too.
author, "Diary of a Real Estate Rookie"
Insider Real Estate Tips with a Twist of Humor: http://tinyurl.com/2ag28z