In this Chapter, we study numerically two two-level systems (two quantum dots or two excitons in a quantum dot) coupled indirectly through an harmonic oscillator (a cavity mode). This corresponds to the simplest realization of the Dicke (1954) model. We analyze the properties of one-photon and two-photon emission and entanglement in the presence of decoherence (dissipation and incoherent pump). The results presented here have been published in the papers 1, 2, 8 and 9 of the list ,6.1 or are in preparation, 13.