One of the things that helps my son with those transitions is to add some structure, so he knows what to expect. This structure ends up being kind of a routine, something he can "count on" even though his interpersonal moment is in flux. He knows his role in this scenario, and he is reassured that he can anticipate what is coming.
When my son was two and three, he had difficulty when the babysitter arrived even though he knew her well. We developed a short routine where he would always pick something ahead of time to "show her" when she came. This way, he knew his role at the time of the greeting and could count on there being something "expected." He felt more in control as well, as if to say "Hi. This is my space and I'm letting you come in. I'm showing you something I like. I'm choosing to invite you in."
We have developed another tradition for when his Nana and Papa are leaving to go back to their home in Michigan after a several day visit.
My parents draw him a picture reminding him of what they did together, that they love him and will be driving home, and that they will see him next time. After we say good bye at the door and talk about when we will see them next, Joshua runs through the house to find the picture which is accompanied by a small gift. This time, he received a Star Wars toothbrush that lights up like a light saber.
What kinds of traditions and routines help your youngster deal with interpersonal transitions?