How can I switch items using mouse buttons instead of the scroll wheel?

I'm not aware of a way to remap the scroll wheel within Minecraft, so I think your best bet is to look for third-party tools that will remap your mouse keys for you. After a quick Google search, I found X-Mouse Button Control for Windows, and USB Overdrive for Mac.

Looking at screenshots of both programs, they both allow you to remap mouse buttons as mouse wheel up {MWUP} and mouse wheel down {MWDN}, which is perfect for item-switching in Minecraft.


X-Mouse:
X-Mouse Button Control

USB Overdrive: USB Overdrive