I think the fault lies with your friend but your DH could easily have rectified the situation, in fact, very easily I think. When friend came over, your husband could have talked about the meal he was making at the time and how excited he was about having a romantic evening with you or how rare it was that you two had time to have a romantic dinner together or even a simple half-joking white lie "yeah dude, lets have a quick beer, I'm gonna need it to get through the cheesy romantic valentines meal tonight to please the misses!" or "ha ha i'm glad you came over and distracted me with a drink, making this romantic meal for darkprincess tonight has had me craving for a shot of whisky and some manly banter!"- little jokey comments like that to give your friend the hint that though he appreciates his company and friendship, he needs him to clear off tonight to spend some time with you. The fact that your DHs friend comes over often unannounced and shares your home and dinners with you must mean that him and your husband are very close.
When it got to the point that your DH realised he may have had too much to drink to drive home safely himself, he could have just been like "oops, I think we got carried away a little bit, how about I call you a cab home so me and dear wife can get down to some "wink wink" accompanied by a cheeky nudge or "lets call you a cab home, normally I'd invite you to stay but the misses was so looking forward to a romantic meal just the two of us, you know how women get sentimental over this mushy valentines day stuff!". That way, your DH could have spared your friends embarrassment and awkwardness for dropping in on valentines day evening, nobody gets offended and the two of you and your daughter could spend a lovely valentines day night together. To answer your question, cheeky light humoured hints would get the job done in any future situation or even like previous posters have said, nothing wrong with a soft, kind, literal to-the-point - "I got a certain something special planned with the wifey tonight". Sometimes even the most oblivious house guests need a nudge.