OK well first it's not exactly necessary, and you will have people claim it does 'nothing.'
That I disagree with. With a factory rifle there are usually imperfections in the bore which can strip jacket material off the bullets passing through the barrels, thereby depositing more copper in the barrel and potentially hurting accuracy. Having a broken in barrel can reduce the rate at which fouling accumulates, and can also make cleaning the bore easier.
How do you do it? Shoot and clean. And really make sure to take care of the copper fouling.
Some call this a 'waste of ammo' if it's a new rifle it doesn't have to be.
Clean the bore, and then fire some test rounds just to make sure the rifle goes 'bang' Clean for carbon and copper.
Then begin your sighting process, walk the rounds in while adjusting the scope, and clean every few rounds.
Then you can test for basic groups, just to get a general idea of how the rifle performs. Shoot 3 shot groups and clean.
From there, just don't let it go too many rounds between cleanings for a while.
Just to clarify 'breaking in' a bore will almost never 'make or break' a rifle. The difference is not going to be incredibly noticeable to some people, but it will vary from person to person as well as rifle to rifle. It's not going to turn a 3 MOA rifle into a sub MOA shooter, so don't expect that either. As long as you clean properly, you're not really hurting anything.
PVL has some good pics of two rifle bores in this post.
http://thefiringline.com/forums/showpost.php?p=5440135&postcount=32
As you can see even though the rougher (button rifled) barrel is more accurate in this instance (oh and remember how I said break-in wont really directly affect accuracy) it does show how rough some factory barrels can be.
If you've got a custom high end barrel it likely wont and shouldn't need break in as it likely has already been lapped. A process which essentially accomplishes the same thing you're trying to do with 'break in'