As a test, try creating a new admin user account in System Preferences
Accounts pane
http://docs.info.apple.com/article.html?path=Mac/10.5/en/8235.html
Log out and log in to the new account. This will help to isolate the cause.
If this problem never recurs in the new account, the problem is likely to be something in your normal user account. It might be some corrupted or mis-set user preference setting. It might be a background process that runs in your normal account; check System Preferences
Accounts pane +Login Items+ tab for any login items (processes that start automatically at login) that may be related to the mouse, and remove anything that should not be there or you no longer need.
If the problem does recur in the new account, the problem is likely to be at the system level, or related to hardware. Is this a third-party mouse, or an Apple mouse? If third-party, does it use a special driver. If so, it may be related to the driver; make sure you are using the latest available version from the manufacturer's web site.