Weigh a sample, dehydrate & re-weight to determine water content, then burn it in pure oxygen in a bomb calorimeter (gives total heat of combustion), then quantitatively analyze the gases produced. For accuracy, correlate the amounts of CO2 and H2O formed with the heat of combustion.