Some canned pumpkin may help. Canned pumpkin helps with a lot of digestive issues, such as upset stomach, diarrhea, and constipation. Be sure to get plain canned pumpkin, though, and not pumpkin pie filling or mix.
Give approximately 1/2 teaspoon of canned pumpkin to your dog if he's small, weighing only a few pounds. If your dog is large, weighing about 75 pounds, you can give him one tablespoon of canned pumpkin.
You're definitely right - you should always consult your vet if your dog is vomiting.