I usually tell my husband when this happens... and then feel uncomfortable around the person anyway. Once or twice he's had to say something to someone. It's always uncomfortable. Usually, people who do this more than once, or don't understand or don't care that it was not appreciated fall out of our social group. Everyone knows My Man and I are monogamous right now, and most people respect it.
There is also a huge difference between a guy friend of ours saying, "P'Gell, you look really beautiful in that dress today." and say it in a way just to be nice, and someone actually hitting on me. I try to give people the benefit of the doubt. Something like, "Hey sweetheart, why don't you ditch that old man and meet me later at _____ for some fun." would be considered completely inappropriate.
Also, if it's completely innocent, (and not aggressive or creepy) I know My Man sometimes gets a kick out of it. He told me recently that at a High School reunion function, he pointed me out to an old buddy of his (who I also knew from long ago) and the friend said, "Her? OMG. Wow. You dog!" It was completely innocent, he was doing nothing more than "congratulating&q uot; My Man on his wife and it never went any further. In fact I didn't find out until much later. The man never said anything to me and My Man said it was done in a appropriate manner, so something like that was OK.