Given how manufacturer document these formats, we have to reverse-engineer or use documentation issued from reverse engineering.
Implementation
dcraw the current reference implementation for RAW decoding.
jrawio a Java library that implements RAW image decoding
File format
RAW file standards try to match current standard with currently undocumented file formats and its summary.
TIFF on which DNG and apparently other RAW format are based on.
Adobe DNG a "standard" format that Adobe tries to push.
X3F Foveon, the Foveon partial documentation.
RAWpository archive of sample image data in RAW formats

