But if you really like this guy anyway, you should have a talk with your friend and explain to her that even if she does have a crush on him, he is your boyfriend, and that you really can't stand it when she flirts with him.
You should also make plans with him, and not invite her. If she has the tendency to invite herself, don't tell her about your plans with him until after they happen. If she gets upset that you aren't inviting her, tell her that you like to be with him alone sometimes, and that you and she can still do things just the two of you, also.
Do things with them separately, but make sure not to always seem like you are choosing your boyfriend over her, either, because that can really hurt her feelings.
I hope that everything works out for the best.