Use the trainer. Get a good one. Get a rock-n-roll. Buy some Spinervals videos. Clip in and put on your gloves. Watch a video or movie with your bike computer set for intervals.
IMHO much better than a spin class, which isn't really riding a bicycle, but simply imitates some of the motions.