Somewhere (I can't remember where) I came across a page by someone on how they cleaned out their N64 controller. If it's an official one then you can get it open with a Philips screwdriver, and then clean it out. The analogue stick module will be full of powdered plastic, from the mechanism inside wearing away. Watch out, as there's a large spring inside that will try to make the module fly across the room.
As far as repairing it goes, I don't think it's possible. Once you've got it open it should be pretty obvious how it's worn. You could try wrapping tape round the stick and/or bars to make up for what's worn away, or if you know how and are up to it then you could try adding a little epoxy or similar. You're probably best off buying a replacement analogue stick module from eBay tho.