1. Breathe
You are half way done with your semester. You can do this.
2. Vent with your friends and family
They might have great ideas on how to make you feel better or even prepare for your next exams. Midterms are important but it's not the end of the world. You just need to be positive and do great in everything that comes next. Don't let that grade discourage you from that goal grade you had.
3. Organize your studying more for finals
Make sure you notice what you did wrong when studying for midterms and correct those mistakes.
4. Regardless the grades you got, work harder next time
Even if you got 100% you need to keep working hard because that A can go to a C without you even noticing it.
5. Don't forget to talk with your professors
They are the BIGGEST source you can have after midterms(well, you are supposed to talk to them since the beginning but that's a start). Don't be afraid to ask any questions or how would your grade look after that awful midterm.
6. Go out, have fun
It's not all about studying, you sometimes need a break from stress and have a glass of wine with good friends. Or even just a walk through the mall(without some splurging) would be ideal.
7. Go workout
Ffter those 20+ hours of hard studying(or cramming) you need to give your mind a break.
Last, breathe again. I know it can be frustrating but you are not alone.
Talk to classmates and relax. You still have time to do great. Dedicate more time to your studies and make sure you realize what you did wrong on your midterms.
Good luck on the rest of the semester!