We report the discovery of two sources at z=3.867 and z=3.427 that exhibit powerful starburst and AGN activities. They benefit from data from radio to X rays from the CFHTLS-D1/SWIRE/XMDS surveys. Follow-up optical and near-infrared spectroscopy, and millimeter IRAM/MAMBO observations are also available. We performed an analysis of their spectral energy distributions to understand the origin of their emission and constrain their luminosities. A comparison with other composite systems at similar redshifts from the literature is also presented. The AGN and starburst bolometric luminosities are ~10^13 Lsun. The AGN emission dominates at X ray, optical, mid-infrared wavelengths, and probably in the radio. The starburst emission dominates in the far-infrared. The estimated star formation rates range from 500 to 3000Msun/yr. The AGN near-infrared and X ray emissions are heavily obscured in both sources with an estimated dust extinction Av>4, and Compton-thick gas column densities. The two sources are the most obscured and most luminous AGNs detected at millimeter wavelengths currently known. The sources presented in this work are heavily obscured QSOs, but their properties are not fully explained by the standard AGN unification model. In one source, the ultraviolet and optical spectra suggest the presence of outflowing gas and shocks, and both sources show emission from hot dust, most likely in the vicinity of the nucleus. Evidence of moderate AGN-driven radio activity is found in both sources. The two sources lie on the local M_BH-M_bulge relation. To remain on this relation, their star formation rate has to decrease. Our results support evolutionary models that invoke radio feedback as star formation quenching mechanism, and suggest that such a mechanism might play a major role also in powerful AGNs.