Sorry, it looks like my previous message was lost.
I'm assuming that you're using a recent ns-3 version, like ns-3-dev or ns-3-42 (FYI ns-3-43 is about to be released).
I'm also assuming that you're familiar with C++ and object oriented coding.
About the class defined in backoff.cc / backoff.h (the class is named Backoff), it is used in a single member variable inside CsmaNetDevice: "Backoff m_backoff;". Its functions do the rest (basically calculating the backoff time). You can explore the CsmaNetDeive code to find where the variable is used and how.
About how the class/functions are used... it's a bit too complex to explain in a single post, but it's explained in the tutorial and manual, check them:
https://www.nsnam.org/documentation/Let me just summarize that if you define a new module, and the module defines a new NetDevice subclass, making it "work" should be as easy as installing a CsmaNetDevice in a node, just like in the examples in the tutorial.
If the above explanation looks incomprehensible to you, I'd suggest to start reading the tutorial and the manual, and then things will be more understandable.