For pigs, the cost of raising is pig is the cost of the newly weaned pig + the cost of the feed to bring the pig to market weight + the cost of the pen to keep it + the cost of the labor.
In western washington, where I farm, a weaner pig will cost you $85. It will take between 600 and 800lbs of feed to get that pig to market weight at $290/ton (July 2010 price). Using the higher weight, that's $116 in feed, giving you a hard-cost of $201.
having someone come to your farm and kill the pig will cost $55, and for that price they will shoot the pig, skin it, gut it and split it down the backbone. For an additional $0.55/lb they'll cut it into your pork chops and roasts and so on.
Adding it all up, you'll pay $201 for the pig and feed, $55 for the kill, and $110 for the cut-and-wrap, for a total of $366. This will yield approximately 150lbs of meat, for a cost per lb of $$2.44 The cut-and-wrap is based on the hanging weight of the pig. Live weight to hanging weight is 75%. Hanging weight to finished cuts is 75%.
I'm not calculating any labor in this and I'm ignoring the price of your pigpen.
People do this all the time. You know exactly what your pig was fed, you have the opportunity to get closer to your food, and you can reduce these costs by using food sources other than purchased feed (surplus bread, expired dairy, etc)