Your first translation :
Je le lui ai demandé ainsi qu'à Sam
is correct, and you are right to say that
Je le lui ai demandé à lui et Sam
is incorrect.
But you might have said:
Je le leur ai demandé, à Sam et lui
Here, it's better to put Sam first, because when you enumerate people, it is recommended to order them from the farthest to the nearest: Paul, toi et moi
and here, "lui" is supposed to be part of the context, so he is nearer than "Sam" who can just appear.
But you can't say:
Il m'a dit de vous parler et à Jeff
Here, you have to separate the complement by repeating vous:
Il m'a dit de vous parler, à vous et à Jeff
or à Jeff et vous