Which part of the knee is the pain localized? Outside of knee (Possible IT Band overuse, so stretch for min 15 min after ride), or the inside (runner's knee). How long was the ride from the shop to the house? A normal spin class lasts about 45 minutes and you will cover 15-20 miles based on your fitness.
As mentioned, lowering your cadence and a good bike fit should solve the problem. Maybe the fit needs to be adjusted.
You may be spinning everyday in class, but how is your spin bike setup? Are the bars too up high? Is the spin bike seat too low? I bet they are, just sit at the back of the class and watch those spinners hips bounce like crazy, and most put the bars too high, which is more comfortable, but really does not mimic the feel of the road bike. So, you may have a entire different setup from your spin bike to road bike, which means you are most likely putting stress on a new area.
If the problem is overuse, you just need to back off a bit when the pain starts, and keep slowly adding speed or time to the ride. Increase about 10% a week, the same as adding miles to your long run.
When you do feel pain you can try to shift your position on the bike and see if you can place yourself in a position where you do not have any pain. I have to do this on long and fast rides multiple times, to engage the correct muscles or remove stress from a fatigued muscle.
For me, spinning classes normally create overuse problems, so I only use Spin classes for recovery rides, and just plod along keeping my HR below 150. I do 1-2 spin classes a week, and about 2-3 rides on my bike a week.
Good Luck! Find a group to ride with. Nothing like asking them to watch your technique on the road, and just bounce questions off them too.