There are two common causes for this illness - food poisoning and viral infections which can be passed from person to person and are very infectious. Careful hand washing will reduce the risk of transmission. In the majority of cases the illness will settle by itself within 2-3 days.
It is very important to replace lost fluid, initially with small frequent sips of clear fluid. An oral rehydration solution e.g. Dioralyte may be useful and can be brought from the chemist.
Babies are at most risk from dehydration and you should seek advise from your Doctor if vomiting continues for more than 24 hours.