The built-in types of C or C++ have a strong logical link to the type of data that hardware, i.e., the processors that are built with high-level language support in mind, has support for directly (in the machine-code instruction set). To take the PowerPC 970 (the G5) processor as an example, it has direct support for 8-, 16-, 32-, 64- and 128-bit integer data in various forms, signed and unsigned, and 32- and 64-bit floating point data. What you want to achieve is basicly a user-defined type of N-bits and operations on this type like unary +, unary -, binary +, binary -, multiplication, division, modulo, logical NOT, logical AND, logical OR, logical XOR, etc, etc, and possible conversions between built-in integer types and your user-defined integer type.
In C++ you can use operator overloading, and in C just simle functions or macros. You should work out the algorithms for the arithmetics you want to operate on your type and then you can bear in mind also that it will most probably not be as efficient as using built-in types because more instructions will be involved, but that is natural of course! In your structure or class you can use an array for a type of known bit-length, etc. Figure out what is efficient for your target platforms, using 8-, 16- or 32-bit, etc, as the element type for that array/vector. Hope this gives you some usefull idéas. Remember, C/C++ built-in types was designed with the typical bit-ranges modelled on the typical bit-lengths of registers in the commonly available processors of the time those languages were invented, but it is up to the compiler to select the instruction-stream for the operations, and it does not have to be single-instructions, although that is often the idéa with built-in types, that they shall be very efficient, yielding the most efficient instruction stream.