The not-too-pleasant smell that can settle into the cloths you use to wash dishes or wipe up counters is from microscopic kitchen gunk that gets trapped in the fibers. Oils, fats and bacteria accumulate in the cloths as you use them. If they aren't washed frequently (using the right method), the oils become rancid and bacteria start to grow and put off a pretty funky smell, especially if you have a good sniffer.
Wash your dish rag out after each use with dish soap and hot water (don't just rinse it). Then thoroughly wring it out and hang it in a spot where it can dry out a little in between uses. The dish soap helps dissolve any fats and a cleaner, drier cloth helps keep bacteria at bay.
Run your dishcloths (and dishtowels too!) through the laundry every couple days, separately from other laundry. Set your washing machine to the hottest setting and select a "heavy duty" cycle. Add 1/2 to 1 cup distilled vinegar (1/2 cup for small loads; 1 cup for large) along with your regular detergent. Don't let the cloths hang out in the washer; get them into the dryer as soon as possible to prevent any straggling bacteria from growing again. Dry on the hottest setting until they're really dry—30 to 45 minutes. Auto moisture sensors may stop the dryer before they're completely done, so check them as soon as the dryer stops and add more time if necessary. Or opt for manual timed drying instead.