I agree with chubba here - the amount you study is what matters, not whether you're taking drugs or not. And it's the only real way to improve your marks.
The one semester I smoked pot daily also happened to be the one I did best in academically. In fact, I wouldn't be surprised if my drug use and grades were positively correlated over the entirety of my degree - but this doesn't necessarily mean taking more drugs increased my grades.
With the pot, I was smoking more often because I was horribly depressed (not a good solution, but it was the one I chose at the time). My use of other drugs seems to increase the more stressed I get as well, but I always try and compensate for this by studying more. And as a result, I've always done well even through semesters where my drug intake was slightly excessive. The extra study has even raised my grades. :D
It sounds like your main problem is concentration. If you can't concentrate in class, chances are you can't concentrate fully when studying either and this might be affecting your performance more than you realise.
This could be due to boredom (in which case you just have to motivate yourself and not give in to laziness), or your lifestyle/diet could be a problem. Eat well and exercise often and your concentration and memory should improve.
I'm a bit of a nerd though, so you might not want to listen to me. :D