Maternal obesity and diabetes dramatically increase the long-term risk for obesity in the next generation, and pregnancy and lactation may be critical periods at which to aim primary prevention to break the obesity cycle. It is becoming increasingly clear that the gut microbiome in newborns and infants plays a significant role in gut health and therefore child development. Alteration of the early infant gut microbiome has been correlated with the development of childhood obesity and autoimmune conditions, including asthma, allergies and, more recently, type 1 diabetes. This is likely to be due to complex interactions between mode of delivery, antibiotic use, maternal diet, components of breastfeeding and a network of regulatory events involving both the innate and adaptive immune systems within the infant host. Each of these factors are critical for informing microbiome development and can affect immune signalling, toxin release and metabolic signals, including short-chain fatty acids and bile acids, that regulate appetite, metabolism and inflammation. In several randomised controlled trials, probiotics have been administered with the aim of targeting the microbiome during pregnancy to improve maternal and infant health but the findings have often been confounded by mode of delivery, antibiotic use, ethnicity, infant sex, maternal health and length of exposure. Understanding how nutritional exposure, including breast milk, affects the assembly and development of both maternal and infant microbial communities may help to identify targeted interventions during pregnancy and in infants born to mothers with obesity or diabetes to slow the transmission of obesity risk to the next generation. The aim of this review is to discuss influences on infant microbiota colonisation and the mechanism(s) underlying how alterations due to maternal obesity and diabetes may lead to increased risk of childhood obesity.