My pipes are cleaned after every smoke with twisted kitchen towel until it comes out clean, shank, chamber and rim. Stems are cleaned with pipe cleaners until they come out clean, and then left to dry for 24 hours.
When I notice the taste being a bit off, or they still smell noticeably after a day of drying I give them a warm to hot water wash, rubbing the chamber with an old toothbrush, finally I put a drop of dish liquid on the toothbrush and give them another brush - this brings out tons of crap, but the plus side is that after drying the pipes have the faintest of smells. Stems are cleaned with pipe cleaners dipped in alcohol, usually pharmacy-grade, pure ethanol that we keep in the bathroom.
I had a very persistent Captain Black ghost in two pipes my uncle gave me, he smoked CB in them for 20 years, any time I reached the heel of the chamber the taste of the tobacco would simply change to CB, wasn't chased out by Latakia, Gawith ropes, Lakelands, salt and alcohol - just the dish soap removed that ghost.