The early microbial colonization of human mucosal surfaces is essential for the development of the host immune system. Already during pregnancy, the unborn child is prepared for the postnatal influx of commensals and pathogens via maternal antibodies, and after birth this protection is continued with antibodies in breast milk. During this critical window of time, which extends from pregnancy to the first year of life, each encounter with a microorganism can influence children's immune response and can have a lifelong impact on their life. For example, there are numerous links between the development of allergies and an altered gut microbiome. However, the exact mechanisms behind microbial influences, also extending to how viruses influence host-microbe interactions, are incompletely understood. In this review, we address the impact of infants' first microbial encounters, how the immune system develops to interact with gut microbiota, and summarize how an altered immune response could be implied in allergies.