As you noted, you can determine from the header signature if it is a Microsoft binary file, but not the specific file type. Unfortunately, if you don’t trust the file extension, there’s no prescribed method for how to determine the file type.
Even though there is no officially endorsed way to determine the file type without the file extension, some third-party utilities have used properties that are unique and required from the Office file formats documentation to create utilities that can determine file type with a high degree of confidence. File for Windows is an open-source example that you could look at for a starting point.
Mike Bowen
Escalation Engineer Microsoft Open Specifications