Really great roundup of various studies re: microbiome here
The influence of diet on the composition of the microbiota has been shown during the initial colonization phase: breast fed infants have higher levels of Bifidobacteria spp. while formula fed infants have higher levels of Bacteroides spp., as well as increased Clostridium coccoides and Lactobacillus spp. . Beyond the postnatal period, the microbiota was suspected to be relatively stable throughout life.
However, several recent studies have shown that dietary factors alter the microbial community resulting in biological changes to the host (Table 1). In fact, the composition of the gut microbiota strongly correlates with diet as demonstrated by a study assessing the relative contributions of host genetics and diet in shaping the gut microbiota and modulating metabolic syndrome phenotypes in mice. In mice fed a diet high in fat, there are many key gut population changes, such as the absence of gut barrier-protecting Bifidobacteria spp.
Overall, dietary changes could explain 57% of the total structural variation in gut microbiota whereas changes in genetics accounted for no more than 12% .
This indicates that diet has a dominating role in shaping gut microbiota and changing key populations may transform healthy gut microbiota into a disease-inducing entity. For example, the “Western” diet, which is high in sugar and fat, causes dysbiosis which affects both host GI tract metabolism and immune homeostasis . This was modeled in a humanized mouse model where adult human fecal microbiota was transplanted into GF mice. The mice were fed a low-fat, plant polysaccharide-rich diet and when switched to a “Western” diet, the microbiota composition shifted to an overgrowth of Firmicutes including Clostridium innocuum, Eubacterium dolichum, Catenibacterium mitsuokai and Enterococcus spp., as well as a significant reduction in several Bacteroides spp. . In mice, carbohydrate-reduced diets result in enriched populations of bacteria from the Bacteroidetes phyla,  and calorie-restricted diets prevent the growth of Clostridium coccoides, Lactobacillus spp. and Bifidobacteria spp., which are all major butyrate producers required for colonocyte homeostasis . Diets rich in complex carbohydrates show less pathogenic species such as Mycobacterium avium subspecies paratuberculosis and Enterobacteriaceae  than diets higher in fat or protein [48,50,51,52].
Complex carbohydrates also increase levels of beneficial Bifidobacteria spp. such as B. longum subspecies longum, B. breve and B. thetaiotaomicron . Refined sugars, on the other hand, mediate the overgrowth of opportunistic bacteria like C. difficile  and C. perfringens by increasing bile output .
Vegetarianism alters intestinal microbiota in humans because high amounts of fiber result in increased short chain fatty acid production by microbes which decrease the intestinal pH. This prevents the growth of potentially pathogenic bacteria such as E. coli and other members of Enterobacteriaceae .
Interestingly, it has been found that European children have a microbiota depleted of Bacteroidetes and enriched in Enterobacteriaceae compared to rural African children which the authors attributed to low dietary fiber intake by Europeans