I assume you mean spin class?
In short, they dont compare well at all to riding on the road, even as a fixed wheel rider, the fixed wheel spin machines that are in my gym are nothing like riding a real bike. At all.
Bare in mind, the people who most gym's are aiming these classes at are people wanting to lose weight, gain a bit of fitness etc and they devise routines based on this. The instructors on the most part are not cyclists, probly dont know much about cycling whatsoever and thus dont devise plans based around improving your road riding performance.
Of course you will gain some valuable fitness etc from it, but its no substitute for the road, riding rollers or a turbo will be the next best thing to riding on the road.