A LOT of great responses here. I think you're mixing problems together though.
Bottom line is you can only do what you can do. There's no need to feel inadequate or pathetic as you put it. That pressure and self loathing are counter productive and ugly. No one walks into a class, out of condition, and rocks it without first adapting to the demands that class places on you. No one. Congratulations, you're just like the rest of us.
The way you overcome that is through CONSISTENT EXERCISE. Once every few weeks or as the mood strikes wont get you anywhere, really. It may keep you from becoming FURTHER out of condition, but it wont help you make a lick of progress. You need regular, structured exercise. Get a day planner, or use your PC. And pick three non-consecutive days a week on which to exercise. Write the exercises you have to do in the planner and then force yourself to do it no matter what. No excuses, no exceptions. Hell, you can write your schedule here and we can all hold you accountable!
Here's the trick though. No session should be more than 30 minutes right now and no session should be so demanding that it leaves you destroyed. Not yet. Not at this stage. You'll get far more out of moderate endurance regularly than destroying yourself and encountering further discouragement.
Even in classes, you have every right to monitor your activity level. In many ways you're just a beginner, Dan. Respect that. Be honest with yourself in both your level of exhaustion, but also in terms of your ability. If you feel worn out, but know you can give a little bit more realistically, then do so. If you feel worn out but know you're spent, take a break.
No one gets in shape NOW. It doesnt happen in a single class or a dozen classes and it doesnt happen by beating yourself into the ground, or beating yourself UP, either.
Patience, honesty and discipline are the buses you need to catch to get to where you're going