If you are mostly interested in the "meaning", perhaps an intuitive answer would be satisfactory. As you mentioned,
when $f$ is a polynomial, then the meaning of $f(T)$ is clear: just substitute $T$ for the polynomial variable.
If $T$ is bounded and self-adjoint, and $f$ is a continuous function on the spectrum of $T$, then one has by Stone-Weiestrass
that
$$
f=\lim_n
p_n,
$$
where the $p_n$ are polynomials. One may then prove that $\lim_n p_n(T)$ exists, as an operator, so it makes a lot
of sense to call the limit $f(T)$.
If $T$ is just bounded, and $f(\lambda)=(z-\lambda)^{-1}$, for $z$ not in the spectrum of $T$, then it also makes sense
to set
$$
f(T)=(z-T )^{-1}.
$$
More generally, if $f$ is holomorphic on some open set $U$ containing the spectrum of $T$, and if $\gamma $ is a closed curve in $U$
winding arround every point of $\sigma (T)$ counter-clockwise once, then Cauchy's integral formula says that
$$
f(\lambda ) = {1\over 2\pi i}\int_\gamma {f(z)\over z-\lambda }\,dz,
$$
for every $\lambda $ in $\sigma (T)$. Again it makes sense to define
$$
f(T) = {1\over 2\pi i}\int_\gamma f(z)(z-T)^{-1}\,dz.
$$
The list goes on and it is possible to give meaning to $f(T)$ in many other situations, such as when $f$ is (possibly
unbounded) and self-adjoint and $f$ is Borel measurable. If you are looking for
references I suggest you search for the terms "functional calculus"!