its a shit situation, but ive been through a lot of shit situations so i might be able to help.
first thing's first, look back to our good friend oscar wilde. "friendship is far more tragic than love...it lasts longer". you're gonna need to let the girl go and hold onto the guy as a friend (i assume you're good mates). to get over her you need to hate her in some way. trying to get her out of your mind while you still like her is mental suicide and you'll mess yourself up trying. you need to hate her first. so think of something she used to do/still does (apart from your friend) that pissed you off. that will make you realise you really don't want to be with her and over time you wont even think about her.
the fact that she's with your friend makes it a tough situation but there's no reason the usual rules dont apply. above all else, and if you really want to get back at her, the best thing you can do is go and enjoy yourself. go and fuck whoever you want and go and enjoy yourself with your friends so that she can see you're just living your life. the only thing that pisses a girl off more than a guy thinking about her is a guy forgetting about her.
long story short, hate the bitch, be friends with the dude.