Chancellor promises to ‘invest, invest, invest’ after months of bleak warnings over economy