I understand that it's feasible the bacteria within the gastrointestinal tract originate from the food we eat and air we breath, but where does this population of microbes originate from?
Most of the initial colonisation is said to be coincidental ('happenstance' as the textbook puts it!) exposure.
It's then fairly predictable depending on:
In terms of feeding, there are differences in flora between babies fed human milk and those that are given cow's milk.
There's a section called 'Establishment and Composition of Normal Flora' in chapter 187 of Principles and Practice of Pediatric Infectious Diseases (3rd ed) by Long which discusses the above.
It's also said that hormones may influence indigenous flora. For example, premenarcheal and postmenopausal vaginal flora are very different to those present during the childbearing period..
There is some interesting information here from the Human Microbiome Project, but no details regarding the source of vaginal microflora. I would say that the sources would be gut and skin.
Ethical issues of manipulating a baby's microbiome are brought to light here.