Well the most important thing in this is your friend's feelings, put yourself in her position, the last thing you would want is to be put in the middle of your boyfriend and your friend! The key is just to be polite, and if you dont like being around him then suggest things for you and her to do like shopping! But dont come across possessive else the boyfriend will be threatened by you and that is not a situation anyone wants to get into xx
You'll just have to put up with him. If you are funny with him or tell her how you feel it could mean the end of your friendship. Just ride with it, if its not meant to be then it will end anyway.