  We study the functional calculus for operators of the form $f_h(P(h))$ within
the theory of semiclassical pseudodifferential operators, where $\{f_h\}_{h\in
(0,1]}\subset C^\infty_c(\mathbb{R})$ denotes a family of $h$-dependent
functions satisfying some regularity conditions, and $P(h)$ is either an
appropriate self-adjoint semiclassical pseudodifferential operator in
$L^2(\mathbb{R}^n)$ or a Schr\"odinger operator in $L^2(M)$, $M$ being a closed
Riemannian manifold of dimension $n$. The main result is an explicit
semiclassical trace formula with remainder estimate that is well-suited for
studying the spectrum of $P(h)$ in spectral windows of width of order
$h^\delta$, where $0\leq \delta <\frac{1}{2}$.
