Washing up liquid and then sterilse before you use them. If they're really bad use bleach and then wash the bleach out with sulphite solution bought from a home brew shop.
VWP is a good soapy cleansing solution -available from home brew shops. If not then soda crystals and warm water. Give a good soaking and scrub with a bottle brush. Rinse out with cold water and sterlise with thin bleach less than an hour before filling with wine/beer.
Dont forget to rinse with cold water after bleaching.
^ in response to John. Not sure how true but I've always been told not to use washing up liquid as its could leave a very thin detergent film on the glass.