Well, first of all, this is not a generic 'public-key' question. With RSA, it can make sense to talk about 'encrypting with the private key', for most other public key algorithms, there's isn't an obvious interpretation. For example, with DSA, the public key operation (which is a signature verification) is 'plug the data from the signature, the hash of the data and the public key into a formula; the signature passes of both sides are the same value'. There's no obvious way to use this type of operation to encrypt something.
Now, in your question, you ask whether encrypting with the RSA private key is secure. Well, that depends on what you mean by secure; what precisely are you attempting preventing someone from doing? In one sense, it is not secure at all; anyone who has the public key can decrypt the message. Since it is generally true that anyone can get the public key, well, this means that this is not at all a secure encryption method.
On the other hand, you might not be assuming that this is a secure encryption method; this might be an attempt to simulate RSA signature generation. Here, you have to be careful; RSA using padding methods to translate between the message being encrypted/signed into a value to give to the raw RSA function. The security properties for an encryption padding method are different from the security properties for a signature padding method; in fact, there are real world secure encryption padding methods (for example, RSAES-PKCS1-v1_5 with e=3) that could be insecure if used as a signature padding method.
However, you may simply be asking "would the key be secure"? In some sense, that is irrelevant; usually, the only reason an attacker wants the keys is that would allow him to perform some operation; if he can perform those operations without the keys (because, for example, of the vulnerabilities mentioned in the above two paragraphs), then he doesn't need the keys. However, if you are still concerned about the keying data, well, it turns out that RSA is safe; performing RSA operations (even on attacker chosen values) doesn't leak the private key.