We present optical and near-infrared ( NIR ) photometry and spectroscopy as well as modelling of the lightcurves of the Type IIb supernova ( SN ) 2011dh . Our extensive dataset , for which we present the observations obtained after day 100 , spans two years , and complemented with Spitzer mid-infrared ( MIR ) data , we use it to build an optical-to-MIR bolometric lightcurve between days 3 and 732 . To model the bolometric lightcurve before day 400 we use a grid of hydrodynamical SN models , which allows us to determine the errors in the derived quantities , and a bolometric correction determined with steady-state NLTE modelling . Using this method we find a helium core mass of 3.1 ^ { +0.7 } _ { -0.4 } M _ { \odot } for SN 2011dh , consistent within error bars with previous results obtained using the bolometric lightcurve before day 80 . We present bolometric and broad-band lightcurves between days 100 and 500 for the steady-state NLTE models . The preferred 12 M _ { \odot } ( initial mass ) model , previously found to agree well with the observed nebular spectra , shows a good overall agreement with the observed lightcurves , although some discrepancies exist . Time-dependent NLTE modelling shows that after day \sim 600 a steady-state assumption is no longer valid . The radioactive energy deposition in this phase is likely dominated by the positrons emitted in the decay of \@element [ ] [ 56 ] [ ] [ ] { \mathrm { Co } } , but seems insufficient to reproduce the lightcurves , and what energy source is dominating the emitted flux is unclear . We find an excess in the K and the MIR bands developing between days 100 and 250 , during which an increase in the optical decline rate is also observed . A local origin of the excess is suggested by the depth of the He i 20581 Å absorption . Steady-state NLTE models with a modest dust opacity in the core ( \tau = 0.44 ) , turned on during this period , reproduce the observed behaviour , but an additional excess in the Spitzer 4.5 \mu m band remains . Carbon-monoxide ( CO ) first-overtone band emission is detected at day 206 , and possibly at day 89 , and assuming the additional excess to be dominated by CO fundamental band emission , we find fundamental to first-overtone band ratios considerably higher than observed in SN 1987A . The profiles of the [ O i ] 6300 Å and Mg i ] 4571 Å lines show a remarkable similarity , suggesting that these lines originate from a common nuclear burning zone ( O/Ne/Mg ) , and using small scale fluctuations in the line profiles we estimate a filling factor of \lesssim 0.07 for the emitting material . This paper concludes our extensive observational and modelling work on SN 2011dh . The results from hydrodynamical modelling , steady-state NLTE modelling , and stellar evolutionary progenitor analysis are all consistent , and suggest an initial mass of \sim 12 M _ { \odot } for the progenitor .