If you want to learn about the DICOM format, "Digital Imaging and Communications in Medicine (DICOM): A Practical Introduction and Survival Guide" by Oleg Pianykh is quite readable and gives a good introduction to key DICOM concepts. Springer-Verlag is the publisher of this book. The full DICOM standard is, of course, the ultimate reference although it is somewhat more intimidating. It is available from NEMA (http://medical.nema.org).
The file format is actually less esoteric than you might imagine and consists of a preamble followed by a sequence of data elements. The preamble contains the ASCII text "DICM" and several reserved bytes that are unused. Following the preamble is a sequence of data elements. Each data element consists of the size of the element, a two-character ASCII code indicating the value representation, a DICOM tag, and the value. Data elements in the file are ordered by their DICOM tag numbers. The image itself is just another data element with a size, value representation, etc.
Value representations specify exactly how to interpret the value. Is it a number? Is it a character string? If it's a character string, is it a short one or a long one and which characters are permitted? The value representation code tells you this.
A DICOM tag is a 4 byte hexadecimal code composed of a 2 byte "group" number and a 2 byte "element" number. The group number is an identifier that tells you what information entity the tag applies to (for example, group 0010 refers to the patient and group 0020 refers to the study). The element number identifies the interpretation of the value (items such as the patient's ID number, the series description, etc.). To find out how you should interpret the value, your code looks up the DICOM tag in a dictionary file.
There are some other details involved, but that's the essence of it. Probably the most instructive thing you can do to learn about the file format is to take an example DICOM file, look at it with a hex editor, and go through the process of parsing it mentally. I would advise against trying to learn about DICOM by looking at existing open source implementations, at least initially. It is more likely to confuse instead of enlighten. Getting the big picture is more important. Once you have the big picture, then you can descend into subtleties.