An ever growing number of observational and theoretical evidence suggests that the deuterated fraction (column density ratio between a species containing D and its hydrogenated counterpart, Dfrac) is an evolutionary indicator both in the low- and the high-mass star formation process. However, the role of surface chemistry in these studies has not been quantified from an observational point of view. In order to compare how the deuterated fractions of species formed only in the gas and partially or uniquely on grain surfaces evolve with time, we observed rotational transitions of CH3OH, 13CH3OH, CH2DOH, CH3OD at 3 and 1.3~mm, and of NH2D at 3~mm with the IRAM-30m telescope, and the inversion transitions (1,1) and (2,2) of NH3 with the GBT, towards most of the cores already observed by Fontani et al.~(2011, 2014) in N2H+, N2D+, HNC, DNC. NH2D is detected in all but two cores, regardless of the evolutionary stage. Dfrac(NH3) is on average above 0.1, and does not change significantly from the earliest to the most evolved phases, although the highest average value is found in the protostellar phase (~0.3). Few lines of CH2DOH and CH3OD are clearly detected, and only towards protostellar cores or externally heated starless cores. This work clearly confirms an expected different evolutionary trend of the species formed exclusively in the gas (N2D+ and N2H+) and those formed partially (NH2D and NH3) or totally (CH2DOH and CH3OH) on grain mantles. The study also reinforces the idea that Dfrac(N2H+) is the best tracer of massive starless cores, while high values of Dfrac(CH3OH) seem rather good tracers of the early protostellar phases, at which the evaporation/sputtering of the grain mantles is most efficient.