If it's something you can plan for (i.e. you know the PCs will meet the NPC) then I normally start with jotting down a) who the person is b) what are their goals and motivations c) what previous knowledge and perception they may have about the PCs (based on rumors or deeds if they're well known, etc) or if the person is a king or something would they treat the PCs are servants or important people, are any of the PCs a race that the NPC is prejudiced against (for better or worse) that might influence his/her reaction to him/her specifically, etc. d) what is their personality, description, etc e) a couple canned responses (at least one of which should be a 'conversation starter' if the PCs ever flounder around without a direct conversational path and need a kick to get the pace moving)
And then repeat those steps for any other NPC of note that would be present in the scene (i.e. probably not "guards that would be quiet in the room and only interfere if there is acombat" but an advisor or other may also speak up in addition to the main person the PCs are going to talk to).
The better you flesh out those items (specifically the part about motivations) the easier it goes. From there, you just have to be read to 'wing it' because you never know what the PCs will ask.
If you know the PCs well, you may be able to preemptively jot down some expected questions and answers... but i've found that players will always ask/do things unexpected even if i know them well...
---
If it's an unplanned encounter (i.e. you don't know / didn't plan for this social encounter to happen), then, well, it's all winging it.
---
If niether you nor your players are much in to "talking things out" (or otherwise really unplanned and don't know how to talk "in character" but know what information should be exchanged) and you wanted to simply treat it as a skill challenge (or a similar concept if not playing 4e) then just devolve it to some skill checks that the players want to use, and decide what new information the PCs learn based on how well that challenge goes (i.e. "after talking to the king for the next two hours about history, nature and rumors, he tells you about some bandits he does need help with but can't get involved with directly due to politics, he also seems to think you're rather unskilled in the ways of the woods due to the way you mixed up two common plant types in your discussion, so he gives you a suggestion on where to hire a scout to guide you ...")
--
anyway, just my rambling thoughts on the topic.