Your confusion is right! Here, in such sentences, the word
couple serves as a determiner which means 'a small number of' or 'a few'. Probably that's why you call them 'random' friends.
When you specifically talk about two friends with their names (as you wrote 'friend 'x' and friend 'xx' who are together), using the word 'couple' would cause some ambiguity.
Waht's the best way to put it then?
Well, call by their names. "My friends Tom and Harry are coming out of the hall.
In case you are talking about your friends Tom and Anna (in a romantic relationship), it adds complexity! Here, 'couple' does not mean 'a few'. Here, it is for two persons.
The closest sentence for that is probably...
A couple who are my friends are coming out of the hall OR
A couple I'm friends with is coming...
Note that it is entirely different from 'a couple of my friends'. And, I think this is your confusion (correct me if I'm wrong).