In the Chilkat code samples:
Set ComAuthorizationEndpoint and set ComTokenEndpoint both use the "Directory (tenant) ID" GUID on the Azure Overview page.
Set ComClientId uses the "Application (client) ID" on the Azure Overview page.
Set ComClientSecret uses the Value of the secret you create on the "Certificates & secrets" page (obvious, perhaps)
On the "Authentication" page, you need to set up a "localhost" redirect URI that uses the same port as the ComListenPort in the Chilkat example (3017 is what they use).
However, to get this to work, I had to set up the Redirect URI under the "Single-page application" platform, rather than the "Mobile and desktop applications" platform (even though it's a Windows application I'm doing this for).
Using a Redirect URI under the "Mobile and desktop applications" resulted in an incomprehensible (at least to me) error message that I was able to Google. Someone mentioned the solution was to set up the redirect under "Single-page application" rather than a "Mobile and desktop application"
Once this was done I was able to get the "OAuth2 authorization granted!" message in the output window and the access token displayed.