With straight cords I get a paper towel wet with diluted rubbing alcohol. Rub it lightly down the cable, leave it for a couple minutes, then take paper towel again, pinch against the cable at one end, and pull the cable through the paper towel. Friction + alcohol cleans off the crap.
Coiled cables I don't bother cleaning...the labour just isn't worth it to me.