I agree with Al Smith, It's a largish topic. if you are getting into it then go to the online help and read up on binary AND, OR and XOR. Then make some functions using these for flipping/reading bits.

ie
Sub SetBit(TheByte as Byte, TheBit as int)
Code goes here to make the bit 'TheBit' in 'TheByte' equal to '1'
End Sub

Then make unsetBit, or setAll bits, ClearAllBits or swapBit or Return Bit x from a byte.

Then chuck all these subs into a Public class and compile it as a DLL which you can reference.

I went though all this writing a GIF encoder in VB.