I understand that you are unable to reach the breakpoint in Visual Studio. Unfortunately, I cannot reproduce the issue on my end. MATLAB R2017b supports debugging with the Visual Studio Community 2017, and it seems that you have all the proper tools installed.
The process you run the code using command in MATLAB should work the same as you click the run button in the Visual Studio in debug mode. Please make sure of the following:
1. Please make sure you are compiling the MEX file using the ‘-g’ flag.
2. Please make sure you are attaching the correct MATLAB process that is used to execute the MEX file.
3. Please check whether breakpoints are set in lines which are reachable at runtime.
If you still experiencing the issue, you may consider getting more information from the Visual Studio support team.