just take the cassette off, spray it with your favorite degreaser (simple green, oil eater, etc), wait a few minutes, rub off the rest of the dirt with a brush of some sort (I use a nylon wheel brush from Pepboys), rinse off and dry.
As for the chain, do yourself a favor and get a masterlink (wipperman or SRAM) - then you can take it apart and put it together for as many times as you would like.