(If you do a search of the forums, you are sure to find this topic discussed at length.)
To clean my chain, after putting the bike on a rear stand, I soak a rag with WD40, and holding the rag tightly on the lower run of the chain, I spin the tire backwards. I keep doing this until I have all the gunk off the chain. LOTS OF PEOPLE will tell you that WD40 is not good for use on o-ring chains, because it can seep in past the o-rings and dissolve the packed grease. Whatever. When my chain needs replacing, I'll replace it. I'm not trying to make it last the life of the bike. Secondly, I'm not heavily spraying it on, so I don't think it's use is all that detrimental. I have seen o-ring chains cleaned and lubed with nothing but WD40 last for 15,000 or more miles. Use your own judgment.
To lube the chain, I use gear oil, applied in the same fashion as my cleaning method. I use a clean rag to remove the excess oil.