Repeat after me: the magazine is part of the weapon. Again. Better.
It always amazes me to see people who keep their guns immaculate but never clean the magazines. Cleaning them seems to be an afterthought. With automatic firearms, the most common causes for feeding failures involve the magazine. A dirty magazine can cause all sorts of trouble.
Now gather around, because I’m going a bit tangential here. There is no reason to have grease or oil inside the magazine. Lubricants will only attract burnt powder and gum up the works, and then we’re right back where we started.
So, how do you clean it? That depends on condition. Some manufacturers (I’m furrowing my brow sternly at Sig Sauer) slather grease and oil on their magazines with the all the abandon of a Jackson Pollock painting. In cases like that, you’ll need some Hoppe’s. Same goes if you (or the previous owner) oiled the internals.
Soak a patch well and run it through the tube with a cleaning rod. It might take a few passes. Soak another and wipe down the whole spring, beginning to end. Do the same for the follower, and inside the baseplate. When you’re done, wipe everything dry.
(The best time to clean the magazines is after you’ve swabbed the barrel and wiped down the inside of the gun. Hoppe’s works better the longer it sits, so take your time.)
A word of caution, here. Magazine springs are often quite a bit of tension, so when you disassemble, be ready to catch a flying chunk of metal if you slip. Wear glasses.
Magazines do not need to be lubricated. Our main concern is protection against rust. The Hoppe’s will leave a bit of residue to protect against this. Once the magazine is clean and dry, it’s ready to go.
For further cleanings, get a silicone cloth. Use it to wipe down the internals of the magazine like you did with the Hoppe’s. Reassemble and live happily ever after.