C++'ify the example application

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>