I would tell Bob that he is in a similar spot to someone wanting to invite only the nice, fun spouse, not their obnoxious spouse, to a wedding or dinner party. Everyone can sympathize! But it is what it is, and Bob seems to know it -- that's why there is a question at all.
I don't see a good way to exclude Shelly and Sam that won't really hurt Shelly's feelings and probably make the rest of the family feel uncomfortable, too, even if no one likes to be around Sam (and maybe others don't mind him as much as the OP does, although they probably do! I would).
It's not as if Sam had done something really heinous like stealing or molesting or is violent or dangerous. He's just annoying as hell. But I think excluding Shelly from family trips because of that is just too draconian. And I doubt he would ruin the entire vacation for everyone.
Every family, and I guess every group of friends, it seems, has at least one spouse or cousin who is a pain to be around, and everyone is quietly relieved when they decline invitations. I know mine does. But we include them anyway for appropriate events. Usually they behave just as they always do. But I can't say it ever ruins the entire event or trip.
Sam's not in the mix on some merit system. Shelly brought him into the family, and there he is, just as much as Bob's wife is. It seems awfully hard on Shelly to exclude her just because Sam has an irritating personality. I know some very nice people who are (inexplicably) married to real jerks, and people put up with those spouses rather than exclude the nice ones. It's not that hard.
So I am with those who say to invite them, but to make very clear what the plans are (I suppose highlighting the things Sam won't like!) and hope that they will either decline or that Sam will behave himself appropriately -- well, better than in the past, anyway! If not, then I wouldn't invite Emily, either. I know that's not the answer that Bob wants. But he knows what the right thing to do here is -- otherwise, there wouldn't even be a question here.