  Let $A$ and $B$ be almost commuting (i.e., the commutator $AB-BA$ belongs to
trace class) self-adjoint operators. We construct a functional calculus
$\varphi\mapsto\varphi(A,B)$ for functions $\varphi$ in the Besov class
$B_{\infty,1}^1({\Bbb R}^2)$. This functional calculus is linear, the operators
$\varphi(A,B)$ and $\psi(A,B)$ almost commute for $\varphi,\,\psi\in
B_{\infty,1}^1({\Bbb R}^2)$, and $\varphi(A,B)=u(A)v(B)$ whenever
$\varphi(s,t)=u(s)v(t)$. We extend the Helton--Howe trace formula for arbitrary
functions in $B_{\infty,1}^1({\Bbb R}^2)$. The main tool is triple operator
integrals with integrands in Haagerup-like tensor products of $L^\infty$
spaces.
