Ignore it.
Fact is, you're not his "friend." You're his mommy. I wouldn't pay it any attention. Just a nod, mildly concerned look and a "Mmm. I see."
In this case, with your milk cup crisis, I love the part of "How to Talk So Kids Will Listen and Listen So Kids Will Talk" that recommends using wishes to help validate his feelings.
"Oh man! You really want that white cup, but it's dirty in the dishwasher. I wish we had 10 white cups so you could have milk in a white cup! Or 20!"
"Yeah! I want 100 white cups!"
"OR 1,000!"
"Or a MILLION!"
And keep going until it's silly. Then he might agree to use the gray cup, or you can suggest: "Well, I could put milk in this clean gray cup, and you can use it until the white cup is clean. What do you think?"
ETA: Regarding him saying "You're not my friend" to others, I'd ignore the phrase, which he is only testing out because it seems to have some power, as NYMetromom describes. I'd instead help him to identify his feelings. "Wow. You seem really mad that you can't use that thing!" Let him speak to his anger. Nod. Look serious. "Oh, your face looks sad right now." Tilt your head, look concerned. Wait. Let him get out whatever he needs to say, and then gently say, "Taylor has been a good friend to you. Remember when he _________? Do you really think that he isn't your friend anymore?"
Some other helpful phrases I often use, and still use, are, "What do YOU think?" And, "Do you really believe that about yourself/that person?"
We parents LOVE to lecture, but I find the best responses come from requiring my boys to think for themselves, to learn the difference between emotions and logical thought.
ETA2: While it may be tempting to just shut him down with a "That's not how you talk to me and I'm not giving you what you want until you're polite." My personal opinion is that you're setting yourself for more upset. He's looking for an outlet for his frustration, and doesn't know yet how to deal with his emotions. Not teaching him how to identify and navigate his emotions will only cause more frustration and anger in the future. Helping him to self identify not only removes his misplaced vitriol toward mommy, but opens the door to communication with you in the future.