never let it get dirty.
simple green/citrus degreaser/OMS...a good stiff bristle brush. spray your cleaner of choice on the cogs, scrub w/ brush, rinse. hot water helps if it's not coming clean. but really, if you never let it get very dirty, you won't have much cleaning to do. sounds like you put too much lube on your chain if it's really tough to clean the cassette.