I've got a separate wheelset for cylocross riding and road riding. Would it be detrimental to the life of my cassette or hubs If I swapped the cassette between my road and off-road wheelset frequently?
The main hazard is that, with so much swapping, you will sooner or later cross-thread the cassette and ruin both cassette and hub. There will also be additional wear on the threaded surfaces and on the spline, where you wrench it on and off. The spline may eventually become too worn to allow removal.
So a lot depends on the care you use -- if you get too casual in doing the swap you're apt to muck it up.