Hi,
Army Reservist / Personal Trainer/ Dad. Hopefully the username gets that across? Anyway..
TL,DR; What is your gym routine? Move about in the office more. Don't reward yourself after the gym, stick to a good balanced diet (but you can have small treats). Drink more water less alcohol/tea/coffee. Muscle is denser than fat and reacts quicker to exercise which could explain the weight gain if you are doing resistance training (lifting weights). Keep up the classes - your overall time spent exercising is bob on. THROW AWAY THE SCALES AND TAPE MEASURES - recognise how you feel and look and go by that. Scales and tape measures are the devil.
Lots of people put weight on immediately after starting an exercise programme. As others have pointed out this is most likely down to muscle growth. Especially if you haven't done much serious exercise beforehand.
Your body is a fantastic and mostly quickly adapting mystery. It's probably gone 'oh ''expletive''' and put your muscle growth into overdrive to cope with the sudden change in routine.
Now whilst this statement - Muscle doesn't weigh more than fat. 1lb is 1lb, whether it's muscle, fat, feathers or a brick. from BLUEsNewSpringWatch - is pretty true, obviously weight is weight. However muscle is more dense than fat and reacts quicker.
When people say 'muscle weighs more than fat' what they mean is proportionally. 1lb of muscle will have less mass than 1lb of fat. The same way that (for arguments sake, these aren't accurate!) 100 bricks might weigh 1 tonne but it would take 10,000 feathers to get the same weight.
The other possible explanation again as others have pointed out is diet. You say you work in an office which are notorious for unconscious snacking. Going to the gym can sometimes trigger what I call the reward switch. And I'm very guilty of this myself. You go to the gym you sweat your butt off and you think yes, I've worked heard I deserve a doughnut. Well maybe two.
The problem is you have to work hard to burn over 500 calories (for example a 5 mile run in under 50 minutes generally burns that much). How many calories in a doughnut? How easy is it to eat more than one?
So it's either one of those. Also be aware parts of you can start to look bigger, especially your belly as your muscles increase but the fat burns off slower. Your core muscles are quite reactive and can grow quite fast if you're giving them a regular beasting. However fat is tough to cut down and it can give the appearance of an even larger belly (older male body builders get this quite a lot).
My advice would be to through away the scales (actually throw them away they cause nothing but drama) and the tape measures. Just go on how you look and feel. You've already identified you feel much better physically. That is what you want to build off of. Focus on getting yourself fitter and your body will change and will adapt.
That said it will all be for naught (unless you're burning thousands of calories a day like we do in the military) if you don't eat right. You can enjoy a treat, in fact I encourage it to maintain basic sanity. But choose smaller options like the ironically named 'fun sized' chocolate bars rather than full sized ones.
Nutrition is not as complicated as nutritionists would have us believe. Just cook as much as possible, use natural ingredients (not necessarily organic - I mean chop and onion rather than buying pre-chopped convenience food) and you'll eliminate a lot of the secret sugar that food processors put in (always check the packaging, low fat brands are actually particularly bad for sneaking in sugar).
Also drink loads of water (your pee should be light in colour) and reduce your alcohol, tea and coffee intake (because it dehydrates you) and approach them as a treat.
Lastly I can give you more information if you provide a bit more detail on the gym routine you are doing? The overall time spent exercising is actually better than average and the classes should be great for you.
I would suggest trying to keep as active in the office as possible. Do squats by the printer/kettle. Take phone calls standing up. Get up and walk about, stretch, shake your arms. Sitting down for 8 hours a day is incredibly damaging to your fitness levels.