Microsoft, which once had little interest in hardware, introduced on Tuesday a laptop, a tablet computer, smartphones and a wearable fitness band.