Building on a recent paper in which we computed the canonical Hamiltonian of a spinning test particle in curved spacetime, at linear order in the particle's spin, we work out an improved effective-one-body (EOB) Hamiltonian for spinning black-hole binaries. As in previous descriptions, we endow the effective particle not only with a mass $\ensuremath{\mu}$, but also with a spin ${\mathbf{S}}_{*}$. Thus, the effective particle interacts with the effective Kerr background (having spin ${\mathbf{S}}_{\mathrm{Kerr}}$) through a geodesic-type interaction and an additional spin-dependent interaction proportional to ${\mathbf{S}}_{*}$. When expanded in post-Newtonian orders, the EOB Hamiltonian reproduces the leading order spin-spin coupling and the spin-orbit coupling through 2.5 post-Newtonian order, for any mass ratio. Also, it reproduces all spin-orbit couplings in the test-particle limit. Similarly to the test-particle limit case, when we restrict the EOB dynamics to spins aligned or antialigned with the orbital angular momentum, for which circular orbits exist, the EOB dynamics has several interesting features, such as the existence of an innermost stable circular orbit, a photon circular orbit, and a maximum in the orbital frequency during the plunge subsequent to the inspiral. These properties are crucial for reproducing the dynamics and gravitational-wave emission of spinning black-hole binaries, as calculated in numerical relativity simulations.