It is awful isn't it, I'm so sorry that you're going through this.
My EX left me with a 1 year old and I was 5 weeks pregnant with our planned second child.
I didn't want to go to bed at night because he was no longer there, I didn't want to eat because we used to eat together and I needed my family to be brutally honest in the end before I accepted what had happened to me.
Take everyday as it comes; sing, talk and rub your belly and know that you're not alone. When the baby kicks play with him or her and make a big deal about sitting down and focusing on the baby in your belly. Go baby shopping, talk to your family about the baby.
As for the birthing classes and the birth the midwives will not want anyone in the room who will cause stress to yourself during this time. I had my EX at my birth and although he wasn't as involved as he would have been had we been together I'm not denying that it was stressful at times because I was still in love with him and afterwards I was left with the baby whilst he went home to do whatever he wanted to do.
I do and I don't regret having him there, it was filled with emotions but we get on well now so I can't complain.
You do not have to have anyone attending your birth if you don't want them to be there.
Talk to your midwife, they were my rock throughout my pregnancy and I text mine whenever I felt down which also helped.
You are not alone, you have that gorgeous baby to look forward to and you will forget about him once you feel the unconditional love that will hit you when you look into your baby's eyes for the first time.
Make plans everyday, go for a walk at least it helps you keep your mind off of things and makes you feel better.
You'll get there, I promise that everyday it will become easier.