Besides the simple managed custom action sample, there are three functional and useful sample tools included in this distribution:
MSI Inventory
Shows a hierarchical, relational, searchable view of all of the product,
feature, component, file, and patch data managed by MSI, for all products
installed on the system.
WiFile
Extracts and updates cabbed files in an MSI setup.
CabPack
Creates simple self-extracting cab packages. OK, so this one isn't
especially useful as a tool, but the code should be helpful.
DDiff
Recursively diffs MSI, MSP, CAB, and other files and directories.
Much more thorough than widiffdb.vbs.