  We construct Komar-type integrals for theories of gravity of higher order in
the Riemann curvature coupled to simple kinds of matter (scalar and vector
fields) and we use them to compute Smarr formulae for black-hole solutions in
those theories. The equivalence between f(R) and Brans-Dicke theories is used
to argue that the dimensionful parameters that appear in scalar potentials must
be interpreted as thermodynamical variables ("pressures") and we give a general
expression for their conjugate potentials ("volumes"}.
