You are in cursor mode for the mouse, correct?
What you have done is use the "look around" function (default = Alt). Holding this button and moving the mouse allows you to move your head around to look about yourself. The problem is, when you let go, your head stays where you left it. So you are basically walking around with your head turned to the left; hence going forward seems like you're going to the right.
Press "center view" (default = Home) to right yourself again
And you if want to look around with the mouse, I suggest you switch the mouse controls to View.