A significant fraction of seasonal and in particular pandemic influenza deaths are attributed to secondary bacterial infections. In animal models, influenza virus predisposes hosts to severe infection with both Streptococcus pneumoniae and Staphylococcus aureus. Despite its importance, the mechanistic nature of the interaction between influenza and pneumococci, its dependence on the timing and sequence of infections as well as the clinical and epidemiological consequences remain unclear. We explore an immune-mediated model of the viral-bacterial interaction that quantifies the timing and the intensity of the interaction. Taking advantage of the wealth of knowledge gained from animal models, and the quantitative understanding of the kinetics of pathogen-specific immunological dynamics, we formulate a mathematical model for immune-mediated interaction between influenza virus and S. pneumoniae in the lungs. We use the model to examine the pathogenic effect of inoculum size and timing of pneumococcal invasion relative to influenza infection, as well as the efficacy of antivirals in preventing severe pneumococcal disease. We find that our model is able to capture the key features of the interaction observed in animal experiments. The model predicts that introduction of pneumococcal bacteria during a 4-6 day window following influenza infection results in invasive pneumonia at significantly lower inoculum size than in hosts not infected with influenza. Furthermore, we find that antiviral treatment administered later than 4 days after influenza infection was not able to prevent invasive pneumococcal disease. This work provides a quantitative framework to study interactions between influenza and pneumococci and has the potential to accurately quantify the interactions. Such quantitative understanding can form a basis for effective clinical care, public health policies and pandemic preparedness.