A survey of proper-motion stars. VI: Orbits for 40 spectroscopic binaries