We study the populations of X-ray sources in the Milky Way in the 15-55 keV band using a deep survey with the BAT instrument aboard the Swift observatory. We present the logN-logS distributions of the various source types and we analyze their variability and spectra. For the low-mass X-ray binaries (LMXBs) and the high-mass X-ray binaries (HMXBs) we derive the luminosity functions to a limiting luminosity of L_X~7 times10^{34} erg s/s. Our results confirm the previously found flattening of the LMXB luminosity function below a luminosity of L_X~10^{37} erg s/s. The luminosity function of the HMXBs is found to be significantly flatter in the 15-55 keV band than in the 2-10 keV band. From the luminosity functions we estimate the ratios of the hard X-ray luminosity from HMXBs to the star-formation rate, and the LMXB luminosity to the stellar mass. We use these to estimate the X-ray emissivity in the local universe from X-ray binaries and show that it constitutes only a small fraction of the hard X-ray background.