Whenever I need to do bit manipulations, I always check the Linux kernel source. I figure that any bit manipulation I'd ever want to do is also done in the kernel, and I'm usually right:
http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...
http://miller.cs.wm.edu/lxr3.linux/http/source/include/linux...
http://miller.cs.wm.edu/lxr3.linux/http/source/lib/bitmap.c?...