An exact analytical solution for generalized growth models driven by a Markovian dichotomic noise