I am still friends with my most recent ex, actually. Our relationship was nice for a long while, but she had too many problems for me to handle. I tried being there for her as much as I could, I really did. But, in the end, it was too much. I broke it off, and we had an... odd relationship following. Eventually, I did tell her we needed a lot of time apart, so we could get over one another. Luckily for me, I found someone I now love, and she seems to be interested in a friend of ours (whom I haven't seen in YEARS actually), so it's good that she's getting over me (I'm not cocky, she just had an attachment to me that was... unhealthy). I talk to her on and off, now, to offer advice when she seeks it.
It's hard to be friends with an ex, it really is. My other experiences were... not as good, post relationship. I lost my best friend because she broke up with me, told me she wanted to get back together a year and a half later, gave her time, and she decided against it and simply cut me out of her life. We had been friends post-break up the first time, though we didn't speak much of senior year of high school (we broke up the summer between junior and senior year). It wasn't until the summer after senior year that we started hanging out again, she brought it up, and then decided against it.
So, while it can be hard to maintain a friendship with an ex, if you truly believe the person is worth it, then try. But both parties must be willing, and, at first, things will be difficult. Time apart always helps, to allow yourself to get over romantic feelings. In any case, those are my two most notable experiences, and thought I would share them.
For what your situation is like, I believe the following things would be beneficial to you both, in the long run:
Spend time apart. Meet new people, if you feel inclined to do so. He has a SO now, and so will make time for her. You should spend more time with friends, family, and meeting new people. The less time you spend with him (to begin with), the better it will be for you to get past your feelings for him and simply view him as a friend. Since most of us here suggested it, it seems to be solid advice.
Set boundaries. If you don't feel comfortable with him jokingly saying certain things or constantly bringing up your time together (again, this is all applicable to you only if that's how the situation is, I am generalizing), then tell him you aren't comfortable with him doing so. Conversely, don't do the same with him, especially when his girlfriend is around. The more you view yourselves as "just friends", the less often you will see him as "my ex-boyfriend". This mentality will help, and it will also help that his new girlfriend will be more comfortable with you, if she doesn't perceive you as a threat.
This one may be the hardest to do, but if he needs to vent/rant about his relationship, you don't always have to be the one to listen. I know being a friend means helping your friends out when they need it most, but you have a certain history with him that may make it difficult for you to be the shoulder he needs to cry on. You must always take your own feelings into account too, and you should let him know this.
Remember, this is all general advice. I don't know your situation specifically, but, hopefully, this will be of some help to you and anyone else who has a similar situation. Good luck with everything!