I understand that the 500 or so possible digraphs and trigraphs have been encoded as single unicode blocks, but I would expect that most computer systems would use the 40 individual letters and use a compositing system rather than use unicode encodings. Is that true?
Unicode has 11,172 (not 500) precomposited Hangul syllable code points (starting with 가, 각, 갃, 간 and ending with 힣) in the Hangul Syllables block. Unicode also supports a compositing encoding system called initial-medial-final encoding (첫가끝 코드 in Korean), which uses separate code points for each jamo (자모, like ㄱ, ㅏ, ㅃ) in a syllable, mainly for old Hangul which is not included in the syllables block. But this method is not well-supported in most software, since most Hangul can be encoded with code points in the syllables block. So no, most software uses precomposed syllables instead of composited (johab, 조합).
Before Unicode existed, there was a widely used encoding called EUC-KR which also contained 1,000 or so commonly used syllables (And the rest was filled with Hanja). Uncommon syllables which could not be expressed with this 1,000 were encoded in johab method, but this also was not widely used.
Before initial-medial-final encoding was standardized in Unicode, people used Hanyang PUA (private use area) code to express old Hangul, which encoded commonly used old Hangul syllables each in one code point. This method is now obsolete, but it's still used due to the lack of software support in the initial-medial-final encoding.
If so, how does it work? Does the typist type just the letters and the computer automatically assembles them into blocks or does the typist have to use control characters to indicate where each letter goes in a block?
The typist types the letters (jamos), and the Hangul IME (Input Method Editor), which comes with your OS, calculates the code point corresponding to your typed syllable (which consists of several jamos), and replaces the jamos with that syllable. The IME effectively converts the typed jamos to the pre-composited syllables. So no, no control codes, although 'Sebeolsik (세벌식)' keyboards use different keys for initial and final jamos.
The jamos can be converted to syllables using this formula:
[{(initial) × 588} + {(medial) × 28} + (final)] + 44032
For example, If you want to find the codepoint of “한” in Unicode, ㅎ=18, ㅏ=0, ㄴ=4, so {(18 × 588) + (0 × 28) + 4} + 44032
equals 54620, which converted into hexadecimal is D55C. U+D55C is the codepoint for syllable '한'.
One issue I see is that the standard western keyboard has only 26 letter keys, but Hangul has 40 different letters.
Some letters are typed with multiple key-strokes, e.g. in the Dubeolsik (두벌식) keyboard, ㄲ is shift + ㄱ, ㅖ is shift + ㅔ, ㅙ is ㅗ + ㅐ, etc.
Once you type with a Korean keyboard, I think you'll understand much better.