To dream that you are having sex with your boss signifies your desires for authority and control. You are feeling empowered.
To dream that you are having sex with a friend refers to the closeness you share with your friend. Because you two share so much between each other and know so much about each other, the dreaming mind may depict this closeness as sex. Alternatively, such a dream indicates a level of attraction between you and your friend, but you are too afraid to act on it. Thus your desires are manifested in a dream.