Double field theory formulation of heterotic strings