17 year-old male living in the U.S. here.
I have a "friend" (Let's call him X) who I've known for 4 years and known well for 2 years. He is probably the most pretentious and manipulative person I know. Sometimes it is genuinely fun to hang out with him - we have a similar sense of humor and our interests are roughly in the same area (Math & CS). I am definitely smarter than him in the traditional sense, better respected, and I can deal with issues in a more civil manner, however he is more "practical" and can read people quite well.
I'll give an example. I have another friend (Y) who I'd known well for 5 years and he had only met a few months ago. One day, us three ended up together and X started being pretentious and degrading making inside jokes/comments with Y in front of me. Y, in turn was being responsive - although she kept saying that A was being mean, she was ultimately laughing and enjoying. Y is usually very kind and does not like jokes/comments that insult. X is 5'4, 90 pounds, and ugly so no chance she could have been attracted. I ended up confused and thus did not say much during the encounter.
Another example - a few days ago I told a few friends (X was there too) I was taking a web. dev. course and working on building a online multiplayer game like pictionary. Few days later, he told me he was working with a mutual friend to do the same thing.
Few respect X, but some feel they can get an advantage if they become X's friend. This is because he has a way of getting information that others can't (or that's what he makes it seem like, even if its wrong).
Being apathetic towards him seemed to be the best solution but one can only do that for so long, especially since our parents are good friends (his parents are actually very kind people).
EDIT: Here are some things that I have tried:
Trying to be close to him while avoiding manipulation and negativity - Again, it works until he says something that I don't agree with, which turns into an argument sucking away time and energy from me. If I am talking to a third person in private environment (e.g. alone) and he sees us, he later tries to pry the conversation topic from said third person, getting information about me (whether or not it is private). Also, if I say anything that can paint me in a negative light - (e.g. "Oh that test? Haha I forgot showing work so I got an 85.") he says that later to someone else in a matter-of-fact way (usually in front of me).
Being apathetic - this works initially but eventually he starts to get unreasonably close to my friends which forces interaction between us. I expect that he would go his way and not try to interact with me, but he seems to become that much more eager to get me to start talking to him again by making me feel oblivious.
Using his tools against him - I tell him just enough about something unimportant to leave him guessing and thinking, thus he becomes more paranoid and does not act rude towards me until he figures out that he was wasting time. This works the first few times, but then he catches on and it also take more effort from my part than I care to use.
How can I
1) Diffuse arguments with X?
2) Stop wasting time dealing with trivial issues with X?
3) Possible maintain a relationship with him enough that I get all the "good stuff" from it (information, opportunities, new people) while not accepting the negativity.