HTC told the press and the htcdev-members (after releasing the SDK) recently that the second lens of the "duo camera" would be something like a depth sensor. It turns out that this is definitely not the case. It is just a simple RGB-cam with 1080p resolution.
I read about the functionality and concept behind the camera on the following page (German only):
Concept of HTC One M8's Duo-Camera (title modified/translated)
On the page there is a sample App called DuoCamTest. It needs a rooted M8, APK and source can be downloaded.
The guys there used an internal debug-interface located at /system/bin/camera_test to take two pictures at the same time. One with full resolution (4 MP) and one with 2 MP (Full HD) using the second rear camera. On a rooted device you can play around with it.
I discovered a way to identify all the three camera-modules. Don't know, if somebody did this before, sorry:
cat /sys/android_camera/sensor cat /sys/android_camera2/sensor cat /sys/android_camera3/sensor