GCB pretty much provided the solution to the logic in your code, now you just need to put structure to it.
1) Visual Basic uses drag and drop to create the UI, so it's pretty easy to do.
2) Create three input boxes and a button for the user to kick off the event to compute the code as the UI.
3) Now you have to verify each input box is a number, so in the button event code block, you can do something like this for each input box:
input1 = InputBox("Please enter a numeric value", "Title to Input Box")
Loop Until IsNumeric(input1) = True
This will check if the input is a number.
4) Only if all three input box returns a true would you then pass the three values into the function GCB provide
result = Z(input1, input2, input3)
5) Now pass the 'result' to a display dialog or however you want to present the answer.