For analog output you use a stereo-mini cable but for digital output you use a mini-Toslink to Toslink cable or a Toslink cable with a Toslink to Toslink-mini adapter.
The optical cable can go directly to a DAC with Toslink input. I don't know if that's preferable to USB output but it works extremely well for me. It's not necessary in using the optical output but I have a Wyred 4 Sound Remedy Reclocker between the iMac and a Pro-Ject Pre Box S2 Digital DAC to reduce the jitter that's inherent in most optical outputs. Using the digital output will certainly give you much better audio than the analog output.