Several ungulates and other species such as seals and primates are known to initially use odour to discriminate their offspring. Most relevant work to study this has been done in sheep; sheep are ideal for studying attachment because there are ethical and logistic difficulties that limit laboratory and research use of most other species known to develop selective mother-young social relationships. In addition domestic sheep are common worldwide, easily bred and handled, and well-understood in terms of behavior and natural history, providing a solid base for more intricate study (more information here).
According to this paper ewes are attracted to amniotic fluid for a few hours after birth, which stimulates nuzzling, sniffling and licking behaviour; after a relatively short time she becomes familiar with the lamb's unique odour. Thereafter, lambs without this odour are almost always rejected. After some time the ewes learn to use visual and auditory cues to identify their lambs and smell becomes less important. The Wikipedia article on the subject gives some information about the neurobiology of the process.
From a selective advantage point of view, I would speculate that this would evolve to reduce the risk of being exploited by 'free-loader' genotypes that engage in behaviour similar to brood parasitism in birds (i.e. leaving their offspring to be cared for by other ewes).
This can work both ways; in addition to the risk of disrupting the smell of a lamb by excessive handling, shepherds have recognised for centuries that lambs which are rejected by their own ewe, or whose ewe has an inadequate milk supply, can be fostered by other ewes who have lost lambs using a technique historically called skin-grafting, where a dead lamb is skinned and the skin tied around the foster lamb. The odour is thus transferred to the foster lamb for long enough for the ewe to accept it and become familiar with its visual and auditory identifiers, after which the odour is no longer important. The paper I cited above above describes a study that found that cloth 'stockinettes' could be used in place of a skin to achieve the same outcome.
edit: Interestingly, the responses to this question at skeptics.SE suggest that the popular notion that odour-based attachment results in abandonment following human interference with birds is probably untrue.