Microsoft has invested in Cruise, the General Motors driverless car unit, in a $2bn funding round that gives the autonomous driving company a $30bn valuation.