Here is how I do it. First I remove the stem and insert a cotton swab into the shank. This acts as both a plug and an absorbent.
Then I take some Kosher salt and fill the bowl with it. Next step is to pour in a little alcohol. Some use Everclear, I tend to use Whiskey or Rum. The higher proof the better is a good rule of thumb. You want just enough alcohol to moisten the salt without soaking it. The alcohol will pull the bad stuff from the walls of the pipe and the salt will absorb it and keep the stuff from going back into the pipe wall.
Place the pipe in a safe place and let it sit for a day or so. You will notice that the salt goes from white to brown as it sits. After a day, you can dump the salt out (it will be crusty by this time) and either repeat if the pipe is really dirty or clean it up with some pipe cleaners. The key here is to get all the salt out of the pipe when you are done. I use pipe cleaners dipped in whiskey to do this.
Next we will work on the stem!