I have a great answer for you... 2 dogs and 2 kids to back it up! If your carpet is colorfast, use some oxyclean to get any discoloration out of it. Once you have put on the oxyclean, while the carpet is still wet, go after the smell. To knock out the smell, use white vinegar mixed with water (1 part vinegar to 3 parts water). The vinegar might make the oxyclean foam up a bit, but don't worry about that, it vacuums right up. For some reason, the acid in the vinegar neutralizes the protein in the throw up. Make sure you pour enough on to saturate the carpet pad, where alot of the smell hides out. After a while (maybe 15 - 30 minutes or so), you can soak up the extra liquid with a towel by standing on it. I tried literally everything, including expensive store products, and nothing worked well. Your house will smell like vinegar for a few hours while your carpet dries, but then it vanishes. I came across this on the internet somewhere a few years ago and swear by it. Good Luck!
PS... This works on any organic stain/smell including urine and other toddler messes!