We propose an extension of a standard stochastic individual-based model in population dynamics which broadens the range of biological applications. Our primary motivation is modelling of immunotherapy for malignant tumors. The main characteristics of the model are distinguishing phenotype and genotype, including environment-dependent transitions between phenotypes that do not affect the genotype, and the introduction of a competition term which lowers the reproduction rate of an individual in addition to the usual term that increases its death rate. We prove that this stochastic process converges in the limit of large populations to a deterministic limit which is the solution to a system of quadratic differential equations. We illustrate the new setup by using it to model various phenomena arising in immunotherapy. Our aim is twofold: on the one hand, we show that the interplay of genetic mutations and phenotypic switches on different timescales as well as the occurrence of metastability phenomena raise new mathematical challenges. On the other hand, we argue why understanding purely stochastic events (which cannot be obtained with deterministic systems) may help to understand the resistance of tumors to various therapeutic approaches and may have non-trivial consequences on tumor treatment protocols and demonstrate this through numerical simulations.