Microsoft has won a government contract to build augmented reality headsets for the U.S. military, the company and the Army separately announced Wednesday, securing a deal expected to bring in roughly $22 billion for the software giant over the next decade.