Is there any code to read/write on a CAN bus

Looking for code to read/write on a CAN bus via the USB. Can purchase an USB adapter if required but looking for a start.