The main thing to understand is that Narcissists do not bond with other people the way that Nons do. So instead of forming an emotional bond, the Narcissist views other people as existing for his pleasure. You will be worth to the Narcissist what you bring to the table in terms of making him happy. This is true of all the Narcissist's relationships, not just friends. A Narcissist will be romantically inclined towards the latest attractive girl to bat her eyelashes at him, and the unaware Narcissist will be convinced himself that she is The One for him and his soulmate. He will lavish her with attention and gifts and she will think she's found the perfect guy. Then he will devalue her over time as he gets bored with her, as she turns out to be less than perfect, or as the thrill of newness wears off. The unaware Narc simply tells himself that he was wrong about her, or even worse, that she deceived him into thinking she was perfect when she wasn't! He will dump her in a huff, as if she is the one who was at fault.
The same goes for friends. A Narc likes friends that are shiny and new. That are entertaining or amusing. That are reliable, even though he won't be reliable when they call for him, or if he is, it's because he is trying to keep them staying loyal to him, not because he cares about them, but because of the benefits they bring to his life. Also, the Narcissist will immediately size up his friends as either capable or incapable of dominating. The Narc is always aware of whether he is in the dominant or submissive role in his relationships and friendships. This is instinct to the Narcissist, who understands only power, not love or empathy.
This is why Narcissists get along with another Narcissists. They are "civil enemies," to quote another poster on this site. They don't threaten the Narcissist by trying to enslave him with intimacy or with the binds of a true relationship based on love and emotion, beyond the emotion of making the Narcissist happy. The Narcissist recoils when someone asks him for anything that doesn't make him happy. This feels like an unreasonable request, even if it's just a ride to the airport.
So to answer your question, a Narcissist will keep you as a friend so long as what you have to offer is important to his overall happiness. He will be loyal to the extent that he benefits from the loyalty. For example, let's say I liked to go to movies, because it makes me happy. But going alone makes me seem awkward, and I worry that people will think poorly of me, which I can't abide as a Narc. So let's say I have a friend who likes movies too. Let's say he'll go with me whenever I want to see a movie. That would be a friend I would keep around so long as I liked going to movies and as long as he would go with me. That friend is important to me because he is providing a service that makes me happier, see? But let's say I meet a beautiful girl who wants to go to movies with me. I will absolutely drop that friend in favor of the girl, because going with her would make me happier.