As far as I know you cannot restrict the mouse from going outside the window of the application. However as stated above it is possible to lock the cursor to the center of the screen.
http://unity3d.com/support/documentation/ScriptReference/Screen-lockCursor.html
At this point you will have to draw your own cursor and handle your own cursor events. You can still calculate the position of the cursor using Input.GetAxis("Mouse X") and Input.GetAxis("Mouse Y") assuming they are configured in Project Settings->Input. You will likely have to detect mouse button clicks using Input.GetMouseButtonXXXX().
↧