On my cassettes, I simply remove them, soak in a container of hot water and favorite heavy duty liquid detergent (Mr. Clean etc.)
Let it soak for awhile and then hit with a bristle brush.
Some of my cassettes are loose cogs which makes it very simple.
You don't want to do that with a free wheel though.